﻿using System;

namespace ILLearn
{
    class Program
    {
        const int WEIGHT = 60;

        static void Main(string[] args)
        {
            var height = 170;

            People people = new Developer("brook");

            var vocation = people.GetVocation();

            var healthStatus = People.IsHealthyWeight(height, WEIGHT) ? "healthy" : "not healthy";

            Console.WriteLine($"{vocation} is {healthStatus}");

            Console.ReadLine();
        }
    }

    abstract class People
    {
        public string Name { get; set; }

        public abstract string GetVocation();

        public static bool IsHealthyWeight(int height, int weight)
        {
            var healthyWeight = (height - 80) * 0.7;
            return weight <= healthyWeight * 1.1 && weight >= healthyWeight * 0.9; //标准体重是 (身高-80) *  0.7，区间在10%内都是正常范围
        }
    }

    class Developer : People
    {
        public Developer(string name)
        {
            Name = name;
        }

        public override string GetVocation()
        {
            return "Developer";
        }
    }
}